<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
	$(function() {
		$('#inputForm input').tooltip();
		$('#inputForm').checkForm();
		$("#own_type1").addClass("active");
		initDataTree(1);
	})
	function confList(type) {
		for ( var i = 1; i < 6; i++) {
			$("#own_type" + i).removeClass("active");
		}
		$("#own_type" + type).addClass("active");
		initDataTree(type);
	}
	function initDataTree(type){
		$.ajax({
			   type: "GET",
			   dataType:"html",
			   cache: false,
			   url: _ctx + "/registry/init_data_tree.do",
			   data: {type:type},
			   success: function( content ){
				   $('#data').html( content ); 
			   },
			   error:function(){
				   ui.msg('信息加载错误', 0);
			   }
		});
	}
	function addConf(){
		var id=$("#id").val();
		var ownId=$("#ownId").val();
		var ownType=$("#ownType").val();
		var limitType=$("input[name='limitType']:checked").val();
		var beginValue=$("#beginValue"+limitType).val();
		var endValue=$("#endValue"+limitType).val();
		$.ajax({
			   type: "post",
			   dataType:"json",
			   cache: false,
			   url: _ctx + "/registry/add_priority_conf.do",
			   data:{
				   id:id,
				   ownId:ownId,
				   ownType:ownType,
				   beginValue:beginValue,
				   endValue:endValue,
				   limitType:limitType
				},
			   success: function( content ){
				   ui.msg(content.msg, 1);
				   initDataTree(ownType);
			   },
			   error:function(){
				   ui.msg('信息加载错误', 0);
			   }
		});
	}
</script>
</head>
<body>
	<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
			<div class="main-content">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> <a href="#">首页</a>
						</li>
						<li><a href="#">平台基础配置</a>
						</li>
						<li><a href="#">优先级配置</a>
						</li>
						<li class="active">列表</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<div class="tabbable">
								<ul class="nav nav-tabs " id="myTab">
									<li id="own_type1" class="active"><a
										href="javascript:void(0);" class="navbar-link"
										onclick="confList(1);">按发送数据分类</a>
									</li>
									<li id="own_type2"><a href="javascript:void(0);"
										class="navbar-link" onclick="confList(2);">按接收系统</a>
									</li>
									<li id="own_type3"><a href="javascript:void(0);"
										class="navbar-link" onclick="confList(3);">按接收节点</a>
									</li>
									<li id="own_type4"><a href="javascript:void(0);"
										class="navbar-link" onclick="confList(4);">按发送系统</a>
									</li>
									<li id="own_type5"><a href="javascript:void(0);"
										class="navbar-link" onclick="confList(5);">按业务域</a>
									</li>
								</ul>
								<div>
									<div class="col-xs-12" style="border: 1px solid #CCC;">
											<div id="data"></div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
